@extends('layouts.default')  
@section('content')
@foreach($data as $d)
<div class="btn-toolbar" role="toolbar">
    <div class="btn-group"><br/>
        <button class="btn btn-default" id="print-test"><i class="fa fa-print" ></i> Print</button>
        <button onclick="location.href='../contract_show/{{ $d->rentalId }}'" class="btn btn-default"><i class="fa fa-file" ></i> Contract</button>
        @if($d->payment_status == '0')

        {{ Helpers\Helper::fa_link_to_action(
                                    'fa fa-money',
                                    'rental_payment',
                                    'Pay',
                                     $d->rentalId, array( 
                                    'class'=>'btn btn-default pay',
                                    'id'=>'pay-invoice',
                                    'data-confirm'=>Lang::get('messages.confirm_payment'))) 
        }}
        @endif

    </div>
</div>
{{  Helpers\Helper::modal(Lang::get('messages.payment_confirm'),Lang::get("messages.close_btn"),Lang::get("messages.ok_btn"),'dataConfirmOK')}}

<div id="divContainer">
    {{ HTML::style('assets/css/invoice.css'); }}
    <header class="clearfix">
        <div id="company">
            {{ HTML::image('assets/img/logo-6.png', 'National Logo', array(
                        'style'=>'width:150px;height:35px;')) }}<br/>
            <h2 class="name">Eurolease shpk</h2>
            <div>Eurolease shpk</div>
            <div>Rr.Dritan Hoxha</div>
            <div>Tirana, 1001</div>
            <div>Albania</div>
            <div>Tel: 0035542255641</div>
            <div>Mobile: 00355694033377</div>
        </div>
    </header>
    <main>
        <div id="details" class="clearfix">
            <div id="client">BILL TO:</div>
            <h2 class="name">{{$cfname.' '.$clname}}</h2>
        </div>
        <div id="invoice">
            <h1>INVOICE {{ $invoice_id }}</h1>
            @if($d->payment_status=='0')
            <div class="date" style="color: #ED591A">Status: Not Paid</div>
            @else
            <div class="date" style="color: #28760b">Status: Paid</div>
            @endif
            <div class="date">Date of Invoice: {{date("Y/m/d",strtotime($invoice_date))}}</div>
            <div class="date">Due Date: {{date("Y/m/d",strtotime($due_date))}}</div>
        </div>
        <table border="0" cellspacing="0" cellpadding="0" style="width:100%;">
            <thead>
                <tr><th>
                    <th class="desc">PRODUCT/SERVICE</th>
                    <th class="unit">QTY</th>
                    <th class="qty">PRICE</th>
                    <th class="total">AMOUNT</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td></td>
                    <td class="desc"><h3>{{$vehicle_id.' '.$make.' '.$model}}</h3>PAGESE FATURE<br/>
                        From: {{date("Y/m/d",strtotime($startdate))}} <br/> To:  {{date("Y/m/d",strtotime($enddate))}}</td>
                    <td class="unit">{{$qty}}</td>
                    <td class="qty">{{number_format($price,2)}}</td>
                    <td class="total">{{number_format($amount,2)}}</td>
                </tr>
            </tbody>
            <tfoot>
                <tr>
                    <td colspan="2"></td>
                    <td colspan="2">TOTAL({{$curency}})</td>
                    <td>{{number_format ($amount,2).' '.$curency}}</td>
                </tr>
                <tr>
                    <td colspan="2"></td>
                    <td colspan="2">PAYMENTS</td>
                    <td></td>
                </tr>
                <tr>
                    <td colspan="2"></td>
                    <td colspan="2">{{date("Y/m/d",strtotime($invoice_date))}}</td>
                    <td>{{number_format($prepaid,2).' '.$curency}}</td>
                </tr>
                <tr>
                    <td colspan="2"></td>
                    <td colspan="2">Amount Due({{$curency}})</td>
                    <td>{{number_format($amountdue,2).' '.$curency}}</td>
                </tr>
                <tr>
                    <td colspan="2"></td>
                    <td colspan="2">Total Paid({{$curency}})</td>
                    <td>{{number_format($amount,2).' '.$curency}}</td>
                </tr>
            </tfoot>
        </table>
    </main>
</div>  
@endforeach
@stop